<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title></title>
	<style>
		*{
			margin:0;
			padding:0;
		}
		body{
			font-family:"微软雅黑";
			background-color:#ddd;
		}
		.module_panel {
			height: 100%;
			width: 100%;
			min-width: 100%;
			display: flex;
			flex-wrap: wrap;
		}

		.module_panel div {
			display: flex;
			justify-content: flex-end;
			align-items: center;
			flex-direction: column;
			margin: 5px;
		}
		.module_panel div img {
			width: 50px;
			height: 50px;
		}



</style>
	<link rel="stylesheet" href="js/plugIn/layui-master/src/css/layui.css">
	<script src="js/plugIn/jquery/jquery.min.js"></script><!--jquery 要在layui之前，这样layui就不会加载内部的jquery-->
	<script src="js/plugIn/layui-master/src/layui.js"></script>

	<script src="js/common/tool.js"></script>
	<script src="config/InitConfig.js"></script>
</head>

<body>
<!-- 上方内容 -->
<!--<div class="box_top">
	<div class="head">
		<span>选择图片</span>

	</div>
</div>-->
<!-- 上方内容 -->

<div class="layui-tab layui-tab-card"  lay-filter="zt_attr_tab" style="border-width: 0px;margin:0px">
	<ul class="layui-tab-title">
		<li class="layui-this">内置图片</li>
		<li>我的图库</li>
	</ul>
	<div class="layui-tab-content" >
		<div class="layui-tab-item layui-show">
			<div class="module_panel" id="listImage">
				<!-- 图片内容 -->

			</div>
		</div>

		<div class="layui-tab-item" >

			<div class="module_panel" id="myListImage">
				<!-- 我的图库 -->

			</div>

		</div>



	</div>
</div>




</body>
<script>

    var baseURL = localStorage.getItem("baseURL");
	layui.use(['element'], function(){
		var UrlParamImg = parent.UrlParam;//其他参数自己从UrlParam中取出来用
		var initjson;

		var initConfig = new InitConfig();
		//读取配置文件
		$.ajaxSettings.async = false; //设置getJson同步
		$.getJSON("config/init.json", function (data){
			initjson=data;
		});

		$.ajaxSettings.async = true;//设置getJson异步

      //初始化（我的图库）
		var module_base = eval("initConfig."+initjson.initMyMoudleFunction+"(UrlParamImg)");


		var myList = "";
		for (var z=0;z<module_base.length;z++){
			var imageurl = baseURL + module_base[z].file_path;
			myList+='<div>';
			myList+='<img style="cursor:pointer" onclick=selectSwitch(\"'+imageurl+'\") src='+imageurl+' alt=""/>';
			myList+='</div>';

		}
		$("#myListImage").html(myList);




	});



	var index = parent.layer.getFrameIndex(window.name);
	var imageList = [
		'config/image/Windmills/1.svg',
		'config/image/Windmills/2.svg',
		'config/image/Windmills/3.svg',
		'config/image/Windmills/4.svg',
		'config/image/Windmills/5.svg',
		'config/image/Windmills/6.svg',
		'config/image/Windmills/7.svg',
		'config/image/Windmills/8.svg',
		'config/image/Windmills/9.svg',
		'config/image/Windmills/10.svg',
		'config/image/Windmills/11.svg',
		'config/image/Windmills/12.svg',
		'config/image/Windmills/13.svg',
		'config/image/Windmills/14.svg',
		'config/image/Windmills/15.svg',
		'config/image/Windmills/16.svg',
		"config/gyyj/03/7.svg",
		"config/image/fan2red.svg",
		"config/gyyj/03/9.svg",
		"config/image/bluefan.svg",
		"config/image/redfan.svg"
		//"config/icon/star.svg"
	];
	var liList = "";
	for (var i=0;i<imageList.length;i++){

		    liList+='<div>';
			liList+='<img style="cursor:pointer" onclick=selectSwitch(\"'+imageList[i]+'\") src='+imageList[i]+' alt=""/>';
			liList+='</div>';
	}
	$("#listImage").html(liList);








	function selectSwitch(iconUrl){
		parent.imageStatusUrl=iconUrl;
		parent.layer.close(index);


	}

</script>
</html>

